home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / progs / lib / hbc / NativePrims.hi < prev    next >
Encoding:
Text File  |  1994-09-27  |  3.3 KB  |  91 lines  |  [TEXT/YHS2]

  1. -- NativePrims.hi -- primitives for native data conversions and I/O
  2. --
  3. -- author :  Sandra Loosemore
  4. -- date   :  07 Jun 1994
  5. --
  6. --
  7.  
  8. interface NativePrims where
  9.  
  10. import Native(Byte,Bytes,ByteFile)
  11. import Prelude(Maybe)
  12.  
  13.  
  14. -- primitive operations on byte files
  15.  
  16. primOpenInputByteFile    :: String -> IO (ByteFile)
  17. primOpenOutputByteFile    :: String -> IO (ByteFile)
  18. primCloseByteFile    :: ByteFile -> IO ()
  19.  
  20.  
  21. primByteShowByteFile    :: Byte -> ByteFile -> IO ()
  22. primByteReadByteFile    :: ByteFile -> IO (Maybe Byte)
  23.  
  24.  
  25. -- conversion functions
  26.  
  27. primCharShowBytes    :: Char -> Bytes -> Bytes
  28. primCharReadBytes    :: Bytes -> Maybe(Char,Bytes)
  29. primCharShowByteFile    :: Char -> ByteFile -> IO ()
  30. primCharReadByteFile    :: ByteFile -> IO (Maybe Char)
  31.  
  32. primIntShowBytes    :: Int -> Bytes -> Bytes
  33. primIntReadBytes    :: Bytes -> Maybe(Int,Bytes)
  34. primIntShowByteFile    :: Int -> ByteFile -> IO ()
  35. primIntReadByteFile    :: ByteFile -> IO (Maybe Int)
  36.  
  37. primFloatShowBytes    :: Float -> Bytes -> Bytes
  38. primFloatReadBytes    :: Bytes -> Maybe(Float,Bytes)
  39. primFloatShowByteFile    :: Float -> ByteFile -> IO ()
  40. primFloatReadByteFile    :: ByteFile -> IO (Maybe Float)
  41.  
  42. primDoubleShowBytes    :: Double -> Bytes -> Bytes
  43. primDoubleReadBytes    :: Bytes -> Maybe(Double,Bytes)
  44. primDoubleShowByteFile    :: Double -> ByteFile -> IO ()
  45. primDoubleReadByteFile    :: ByteFile -> IO (Maybe Double)
  46.  
  47. primShortShowBytes    :: Int -> Bytes -> Bytes
  48. primShortReadBytes    :: Bytes -> Maybe(Int,Bytes)
  49. primShortShowByteFile    :: Int -> ByteFile -> IO ()
  50. primShortReadByteFile    :: ByteFile -> IO (Maybe Int)
  51.  
  52.  
  53. {-# 
  54. primOpenInputByteFile    :: LispName("prim.open-input-byte-file")
  55. primOpenOutputByteFile    :: LispName("prim.open-output-byte-file")
  56. primCloseByteFile    :: LispName("prim.close-byte-file")
  57.  
  58. primByteShowByteFile    :: LispName("prim.show-byte-file")
  59. primByteReadByteFile    :: LispName("prim.read-byte-file")
  60.  
  61. primCharShowBytes    :: LispName("prim.char-show-bytes"), NoConversion,
  62.                 Strictness("S,N")
  63. primCharReadBytes    :: LispName("prim.char-read-bytes"), NoConversion
  64. primCharShowByteFile    :: LispName("prim.char-show-byte-file"), NoConversion
  65. primCharReadByteFile    :: LispName("prim.char-read-byte-file"), NoConversion
  66.  
  67. primIntShowBytes    :: LispName("prim.int-show-bytes"), NoConversion,
  68.                 Strictness("S,N")
  69. primIntReadBytes    :: LispName("prim.int-read-bytes"), NoConversion
  70. primIntShowByteFile    :: LispName("prim.int-show-byte-file"), NoConversion
  71. primIntReadByteFile    :: LispName("prim.int-read-byte-file"), NoConversion
  72.  
  73. primFloatShowBytes    :: LispName("prim.float-show-bytes"), NoConversion,
  74.                 Strictness("S,N")
  75. primFloatReadBytes    :: LispName("prim.float-read-bytes"), NoConversion
  76. primFloatShowByteFile    :: LispName("prim.float-show-byte-file"), NoConversion
  77. primFloatReadByteFile    :: LispName("prim.float-read-byte-file"), NoConversion
  78.  
  79. primDoubleShowBytes    :: LispName("prim.double-show-bytes"), NoConversion,
  80.                 Strictness("S,N")
  81. primDoubleReadBytes    :: LispName("prim.double-read-bytes"), NoConversion
  82. primDoubleShowByteFile    :: LispName("prim.double-show-byte-file"), NoConversion
  83. primDoubleReadByteFile    :: LispName("prim.double-read-byte-file"), NoConversion
  84.  
  85. primShortShowBytes    :: LispName("prim.short-show-bytes"), NoConversion,
  86.                 Strictness("S,N")
  87. primShortReadBytes    :: LispName("prim.short-read-bytes"), NoConversion
  88. primShortShowByteFile    :: LispName("prim.short-show-byte-file"), NoConversion
  89. primShortReadByteFile    :: LispName("prim.short-read-byte-file"), NoConversion
  90. #-}
  91.